/*
 * Copyright 2024 NXP
* NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms.  If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/
/*******************************************************************************
 * Size: 14 px
 * Bpp: 4
 * Opts: undefined
 ******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl.h"
#endif

#ifndef LV_CUSTOMER_FONT_SOURCEHANSERIFSC_REGULAR_14
#define LV_CUSTOMER_FONT_SOURCEHANSERIFSC_REGULAR_14 1
#endif

#if LV_CUSTOMER_FONT_SOURCEHANSERIFSC_REGULAR_14

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+4E0E "与" */
    0x0, 0x2, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x6, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8,
    0x60, 0x0, 0x0, 0x8, 0x40, 0x0, 0xb, 0x86,
    0x66, 0x66, 0x66, 0x50, 0x0, 0xd, 0x10, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x3f, 0x66, 0x66, 0x66,
    0x6b, 0x20, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1e,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x2c, 0x0,
    0x26, 0x66, 0x66, 0x67, 0xf5, 0x4a, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x77, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0xb4, 0x0, 0x0, 0x0, 0x0,
    0x14, 0x35, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0xad, 0x40, 0x0,

    /* U+50A8 "储" */
    0x0, 0x28, 0x0, 0x0, 0x19, 0x0, 0x0, 0x0,
    0x7, 0x97, 0x20, 0x2, 0xb0, 0x4, 0x0, 0x0,
    0xb4, 0x2c, 0x6, 0x7d, 0xaa, 0xe2, 0x0, 0xd,
    0x0, 0x40, 0x2, 0xb0, 0xc4, 0x0, 0x3, 0xe4,
    0x6c, 0x10, 0x2b, 0x97, 0x22, 0x0, 0x8d, 0x0,
    0xd3, 0x67, 0xdb, 0x68, 0x80, 0x16, 0xd0, 0xd,
    0x0, 0x76, 0x0, 0x30, 0x2, 0xd, 0x0, 0xd0,
    0x7e, 0x66, 0x7e, 0x10, 0x0, 0xd0, 0xd, 0x30,
    0xd0, 0x1, 0xc0, 0x0, 0xd, 0x0, 0xd1, 0x2e,
    0x66, 0x7c, 0x0, 0x0, 0xd0, 0xf, 0x90, 0xd0,
    0x1, 0xc0, 0x0, 0xd, 0x4, 0xb0, 0xe, 0x66,
    0x7c, 0x0, 0x0, 0xc0, 0x0, 0x0, 0xc0, 0x1,
    0xb0, 0x0,

    /* U+56DE "回" */
    0x10, 0x0, 0x0, 0x0, 0x0, 0x20, 0xa8, 0x66,
    0x66, 0x66, 0x66, 0xf3, 0xa3, 0x0, 0x0, 0x0,
    0x0, 0xe0, 0xa3, 0x3, 0x0, 0x4, 0x0, 0xe0,
    0xa3, 0xd, 0x66, 0x6d, 0x50, 0xe0, 0xa3, 0xd,
    0x0, 0xb, 0x20, 0xe0, 0xa3, 0xd, 0x0, 0xb,
    0x20, 0xe0, 0xa3, 0xd, 0x0, 0xb, 0x20, 0xe0,
    0xa3, 0xd, 0x66, 0x6d, 0x20, 0xe0, 0xa3, 0x6,
    0x0, 0x4, 0x0, 0xe0, 0xa3, 0x0, 0x0, 0x0,
    0x0, 0xe0, 0xa8, 0x66, 0x66, 0x66, 0x66, 0xf0,
    0xa2, 0x0, 0x0, 0x0, 0x0, 0xc0,

    /* U+5B58 "存" */
    0x0, 0x0, 0x7, 0x40, 0x0, 0x0, 0x0, 0x0,
    0x0, 0xe1, 0x0, 0x0, 0x10, 0x6, 0x66, 0x8d,
    0x66, 0x66, 0x6d, 0x80, 0x0, 0xb, 0x20, 0x0,
    0x0, 0x0, 0x0, 0x4, 0x93, 0x66, 0x66, 0x89,
    0x0, 0x0, 0xd2, 0x0, 0x0, 0x2d, 0x30, 0x0,
    0x8f, 0x0, 0x0, 0x59, 0x0, 0x0, 0x64, 0xe0,
    0x0, 0xd, 0x10, 0x72, 0x12, 0xe, 0x16, 0x66,
    0xe7, 0x67, 0x50, 0x0, 0xe0, 0x0, 0xd, 0x0,
    0x0, 0x0, 0xe, 0x0, 0x0, 0xd0, 0x0, 0x0,
    0x0, 0xe0, 0x2, 0x1e, 0x0, 0x0, 0x0, 0xc,
    0x0, 0x2b, 0xb0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0,

    /* U+653E "放" */
    0x0, 0x14, 0x0, 0x0, 0x74, 0x0, 0x0, 0x0,
    0x9, 0x50, 0x0, 0xe3, 0x0, 0x0, 0x0, 0x2,
    0x83, 0x42, 0xe0, 0x0, 0x20, 0x36, 0xc7, 0x67,
    0x86, 0xc6, 0x6b, 0xc1, 0x0, 0xd1, 0x0, 0xa,
    0x40, 0xf, 0x0, 0x0, 0xe7, 0x6c, 0x46, 0x60,
    0x3c, 0x0, 0x0, 0xe0, 0xd, 0x50, 0x70, 0x78,
    0x0, 0x0, 0xc0, 0xd, 0x0, 0x63, 0xd2, 0x0,
    0x1, 0x90, 0xd, 0x0, 0xc, 0x90, 0x0, 0x5,
    0x60, 0x1c, 0x0, 0xe, 0x50, 0x0, 0x8, 0x10,
    0x3a, 0x0, 0xa5, 0xd2, 0x0, 0x8, 0x12, 0x96,
    0x9, 0x30, 0x4e, 0x50, 0x40, 0x9, 0xc3, 0x60,
    0x0, 0x4, 0xc2, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0,

    /* U+8BED "语" */
    0x2, 0x30, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0,
    0xa4, 0x26, 0x69, 0x86, 0x69, 0x30, 0x0, 0x3b,
    0x0, 0xb, 0x10, 0x0, 0x0, 0x0, 0x30, 0x16,
    0x6e, 0x66, 0xd4, 0x0, 0x46, 0xd5, 0x0, 0x2a,
    0x0, 0xb1, 0x0, 0x0, 0xb2, 0x0, 0x66, 0x0,
    0xb2, 0x10, 0x0, 0xb2, 0x66, 0xa8, 0x66, 0xb9,
    0xb0, 0x0, 0xb2, 0x0, 0x0, 0x0, 0x1, 0x0,
    0x0, 0xb2, 0x2, 0xc6, 0x66, 0x9c, 0x0, 0x0,
    0xb2, 0x43, 0xb0, 0x0, 0x49, 0x0, 0x0, 0xcc,
    0x32, 0xb0, 0x0, 0x49, 0x0, 0x1, 0xd2, 0x2,
    0xd6, 0x66, 0x99, 0x0, 0x0, 0x0, 0x2, 0x90,
    0x0, 0x48, 0x0,

    /* U+97F3 "音" */
    0x0, 0x0, 0x0, 0x72, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x3b, 0x0, 0x7, 0x0, 0x3, 0x66,
    0x96, 0x66, 0x6c, 0x88, 0x40, 0x0, 0x0, 0xa3,
    0x0, 0x3d, 0x10, 0x0, 0x0, 0x0, 0x4a, 0x0,
    0x92, 0x1, 0x30, 0x16, 0x66, 0x67, 0x66, 0x96,
    0x69, 0xb1, 0x0, 0x1, 0x0, 0x0, 0x0, 0x20,
    0x0, 0x0, 0xe, 0x66, 0x66, 0x66, 0xf2, 0x0,
    0x0, 0xe, 0x0, 0x0, 0x0, 0xe0, 0x0, 0x0,
    0xe, 0x66, 0x66, 0x66, 0xe0, 0x0, 0x0, 0xe,
    0x0, 0x0, 0x0, 0xe0, 0x0, 0x0, 0xe, 0x66,
    0x66, 0x66, 0xe0, 0x0, 0x0, 0xd, 0x0, 0x0,
    0x0, 0xd0, 0x0
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 91, .adv_w = 224, .box_w = 15, .box_h = 13, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 189, .adv_w = 224, .box_w = 12, .box_h = 13, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 267, .adv_w = 224, .box_w = 13, .box_h = 14, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 358, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 456, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1},
    {.bitmap_index = 547, .adv_w = 224, .box_w = 14, .box_h = 13, .ofs_x = 0, .ofs_y = -1}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_0[] = {
    0x0, 0x29a, 0x8d0, 0xd4a, 0x1730, 0x3ddf, 0x49e5
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 19982, .range_length = 18918, .glyph_id_start = 1,
        .unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 7, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};



/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LVGL_VERSION_MAJOR == 8
/*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
#endif

#if LVGL_VERSION_MAJOR >= 8
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 1,
    .bpp = 4,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LVGL_VERSION_MAJOR == 8
    .cache = &cache
#endif
};



/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t lv_customer_font_SourceHanSerifSC_Regular_14 = {
#else
lv_font_t lv_customer_font_SourceHanSerifSC_Regular_14 = {
#endif
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 14,          /*The maximum line height required by the font*/
    .base_line = 2.1,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = -1,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc,          /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
#if LV_VERSION_CHECK(8, 2, 0) || LVGL_VERSION_MAJOR >= 9
    .fallback = NULL,
#endif
};



#endif /*#if LV_CUSTOMER_FONT_SOURCEHANSERIFSC_REGULAR_14*/

